<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    //打印100以内7的倍数
    for (var i = 1; i <= 100; i++) {
        if (i % 7 == 0) {
            // console.log(i);
            document.write(" " + i);
        }
    }
    document.write("<br>");
    //打印100以内的奇数
    for (var i = 1; i <= 100; i++) {
        if (i % 2 != 0) {
            // console.log(i);
            document.write(" " + i);
        }
    }
    document.write("<br>");
    //打印100以内所有的偶数和
    var sum = 0, x = 0, y = 0;
    for (var i = 1; i <= 100; i++) {
        x += i;
        if (i % 2 == 0) {
            sum += i;
        } else {
            y += i;
        }
    }
    document.write("0-100的偶数和为" + sum + "<br>0-100的奇数和为" + y + "<br>0-100总和为" + x + "<br>");
    //打印图形
    for (var i = 1; i <= 40; i++) {
        document.write("*");
        if (i % 10 == 0) {
            document.write("<br>");
        }
    }
</script>

</html>